package com.xcdh.ittools.config;

import com.api.ittools.entity.ToolDatasource;
import com.xcdh.ittools.type.ITToolReturnType;
import com.xcdh.ittools.utils.MysqlDbUtil;
import org.apache.ibatis.session.Configuration;

import java.sql.Connection;

public class ITToolConfiguration extends Configuration {

    private ITToolReturnType itToolReturnType ;

    private ToolDatasource datasource ;


    public ITToolConfiguration(){}
    public ITToolConfiguration( ToolDatasource datasource , ITToolReturnType itToolReturnType ){
        this.datasource = datasource ;
        this.itToolReturnType = itToolReturnType ;
        this.mapUnderscoreToCamelCase = true ;
    }



    public Connection getConnection(){
        return MysqlDbUtil.getConnection(this.datasource) ;
    }

    public ITToolReturnType getItToolReturnType(){
        return itToolReturnType ;
    }



}
